import request from '@/utils/request'

export function list() {
  return request({
    url: 'api/appManager/list',
    method: 'get'
  })
}

export function add(data) {
  return request({
    url: 'api/appManager/add',
    method: 'post',
    data
  })
}

export function del(data) {
  return request({
    url: 'api/appManager/del',
    method: 'post',
    data
  })
}

export function edit(data) {
  return request({
    url: 'api/appManager/edit',
    method: 'post',
    data
  })
}

export function selectPages() {
  return request({
    url: '/api/appManager/selectPages',
    method: 'get'
  })
}

export function selectUsers(data) {
  return request({
    url: '/api/sysUser/select',
    method: 'post',
    data
  })
}

export function selectDbList(data) {
  return request({
    url: '/api/sysDb/qryList',
    method: 'post',
    data
  })
}

export function checkAppData(data) {
  return request({
    url: '/api/appManager/checkAppData',
    method: 'post',
    data
  })
}
export function selectCondition(data) {
  return request({
    url: '/api/appManager/selectCondition?page='+(data.page.page-1)+'&size='+data.page.size+
    '&appName='+data.appName+'&appAdmin='+data.appAdmin,
    method: 'get'
  })
}

export default { list, add, del, edit, selectPages, selectUsers, selectCondition, selectDbList, checkAppData }
